<template>
  <div class="home-banner">
    <Slider :data="list"></Slider>
  </div>
</template>

<script>
import { ref } from 'vue'
import { getBanner } from '@/api/home'

const useSlider = () => {
  const list = ref([])
  const getList = async () => {
    const { result } = await getBanner()
    // console.log(result)
    list.value = result
  }
  getList()
  return { list }
}

export default {
  name: 'HomeBanner',
  setup () {
    const { list } = useSlider()
    return { list }
  }
}
</script>

<style scoped lang='less'>
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
